package com.ruoyi.academic.mapper;

import java.util.List;

import com.ruoyi.academic.domain.StuVO;
import com.ruoyi.academic.domain.StudentAcademicInfo;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

/**
 * 学生学业信息Mapper接口
 *
 * @author dongyv
 * @date 2025-05-15
 */
public interface StudentAcademicInfoMapper
{
    /**
     * 查询学生学业信息
     *
     * @param serialNumber 学生学业信息主键
     * @return 学生学业信息
     */
    public StudentAcademicInfo selectStudentAcademicInfoBySerialNumber(Long serialNumber);

    /**
     * 查询学生学业信息列表
     *
     * @param studentAcademicInfo 学生学业信息
     * @return 学生学业信息集合
     */
    public List<StudentAcademicInfo> selectStudentAcademicInfoList(StudentAcademicInfo studentAcademicInfo);

    /**
     * 新增学生学业信息
     *
     * @param studentAcademicInfo 学生学业信息
     * @return 结果
     */
    public int insertStudentAcademicInfo(StudentAcademicInfo studentAcademicInfo);

    /**
     * 修改学生学业信息
     *
     * @param studentAcademicInfo 学生学业信息
     * @return 结果
     */
    public int updateStudentAcademicInfo(StudentAcademicInfo studentAcademicInfo);

    /**
     * 删除学生学业信息
     *
     * @param serialNumber 学生学业信息主键
     * @return 结果
     */
    public int deleteStudentAcademicInfoBySerialNumber(Long serialNumber);

    /**
     * 批量删除学生学业信息
     *
     * @param serialNumbers 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteStudentAcademicInfoBySerialNumbers(Long[] serialNumbers);

    public List<StudentAcademicInfo> selectStudentAcademicInfoList_student(String teacherId);


    @Select("SELECT "+
            "student_id, course_name, student_name, final_grade, academic_year "+
            "FROM student_academic_info "+
            "WHERE student_id = #{studentId}")
    @Results({
                    @Result(property = "studentId", column = "student_id"),
                    @Result(property = "courseName", column = "course_name"),
                    @Result(property = "studentName", column = "student_name"),
                    @Result(property = "finalGrade", column = "final_grade"),
                    @Result(property = "semester", column = "academic_year")
            })
    List<StuVO> selectByStudentId(String studentId);

}
